import React, { FC, useContext } from 'react';
import { View, Text } from '@tarojs/components';
import { styled } from 'linaria/react';
import { useClassName } from '@/utils/index';
import { LoginFormContext } from '../LoginFormContext';
import MyInput from '../MyInput/MyInput';
import GetCodeBtn from './GetCodeBtn/GetCodeBtn';
export interface IProps extends ICompProps {}
Code.defaultProps = {} as Partial<IProps>;
function Code(props: IProps) {
    const { className, style } = props;
    const localClassName = useClassName('Code', className);
    const { loginForm, valChange } = useContext(LoginFormContext);
    return (
        <RootView className={localClassName} style={style}>
            <MyInput
                value={loginForm.code}
                onChange={(e) => valChange('code', e)}
                placeholder="请输入验证码"
                inputAppendSlot={<GetCodeBtn></GetCodeBtn>}></MyInput>
        </RootView>
    );
}
export default React.memo(Code as FC<IProps>);
const RootView = styled(View)`
    &.Code {
   
    }
`;
